﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace vwsol_DuHoc.Areas.Administrator.Models
{
    [MetadataType(typeof(CourseMetadata))]
    public partial class Course
    {
        public void Default()
        {
            if (this.CourseContent == null)
            {
                this.CourseContent = "";
            }
            if (this.Image == null)
            {
                this.Image = "~/Resource/img/noimg.gif";
            }
            this.IsDelete = false;
            this.CreateDate = DateTime.Now;
        }
    }

    public class CourseMetadata
    {
        [Required]
        public string CourseName { get; set; }
        [Required]
        public string CourseDescription { get; set; }
        [AllowHtml]
        public string CourseContent { get; set; }
    }
}